package com.ibm.mall.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibm.mall.dao.ShippingAddressDao;
import com.ibm.mall.model.PageBean;
import com.ibm.mall.model.ShippingAddress;
import com.ibm.mall.model.User;
import com.ibm.mall.service.ShippingAddressService;
import com.ibm.mall.util.QueryHelper;

@Service
@Transactional
public class ShippingAddressServiceImpl implements ShippingAddressService {

	@Resource
	private ShippingAddressDao shippingAddressDao;
	
	@Override
	public PageBean getPageBean(Integer pageNum, int pageSize,
			QueryHelper queryHelper) {
		return shippingAddressDao.getPageBean(pageNum, pageSize, queryHelper);
	}

	@Override
	public void addContact(ShippingAddress contact) {
		shippingAddressDao.save(contact);
	}

	@Override
	public void deleteContact(Integer contactId) {
		shippingAddressDao.delete(contactId);
	}

	@Override
	public void updateContact(ShippingAddress contact) {
		shippingAddressDao.update(contact);
	}

	@Override
	public List<ShippingAddress> getAllShipperAddressByUser(User user) {
		return shippingAddressDao.getAllShipperAddressByUser(user);
	}

}
